package cn.base.day08;

public class Test03 {
    public static void main(String[] args) {
        String s1 = "abcdefg";
        //charAt 获取指定位置的字符
        for (int i = 0; i < s1.length(); i++) {
            System.out.print(s1.charAt(i) + " ");
        }
        System.out.println();

        //把字符串转化为字符数组
        char[] cs = s1.toCharArray();
        for (int i = 0; i < cs.length; i++) {
            System.out.print(cs[i] + " ");
        }
    }
}
